Skip to content

[css-color-4] Correction to ray trace to avoid throwing off our intersect calculation and match MINDE flow #10579#13416

Merged
svgeesus merged 3 commits intow3c:mainfrom
facelessuser:css-color-4/fix-raytrace
Feb 18, 2026
Merged

[css-color-4] Correction to ray trace to avoid throwing off our intersect calculation and match MINDE flow #10579#13416
svgeesus merged 3 commits intow3c:mainfrom
facelessuser:css-color-4/fix-raytrace

Conversation

@facelessuser
Copy link
Contributor

@facelessuser facelessuser commented Jan 30, 2026

My suggested fix via #10579 (comment) was not the ideal fix and artificially limited tnear. This is a numerical instability issue and should be addressed as such by using an epsilon comparison to prevent rays that are too small. This corrects the fix.

I've also adjusted the algorithm to match the flow of MINDE in regardless to checking lightness before returning out of gamut colors.

I also revised the cleanup step. Since the destination is a gamut-bound space, we can clip there as we do in MINDE.

Related #10579

…section calculation

The suggested fix via w3c#10579 (comment)
was not the ideal fix and artificially limited `tnear`. This is a
numerical instability issue and should be addressed as such by using an
epsilon compare to prevent rays that are too small.

Related w3c#10579
@facelessuser facelessuser force-pushed the css-color-4/fix-raytrace branch from d55fb79 to db955e1 Compare February 2, 2026 04:51
@svgeesus
Copy link
Contributor

svgeesus commented Feb 2, 2026

@facelessuser could you please:

  1. Create a W3C account, if you don't already have one
  2. Link your GitHub and W3C accounts (the menu item "Connected accounts" on your W3C account page).

I can then make a link for an individual royalty free license commitment (for the whole Ray Trace GM, not just this specific pull request). Thanks!

@facelessuser
Copy link
Contributor Author

Excellent, I'll create an account!

- Return unbounded colors
- Return black/white if SDR lightness is exceeded.
- Then if color is out of gamut continue chroma reduction
@facelessuser facelessuser changed the title [css-color-4] Correction to ray trace to avoid throwing off our intersect calculation #10579 [css-color-4] Correction to ray trace to avoid throwing off our intersect calculation and match MINDE flow #10579 Feb 2, 2026
@facelessuser
Copy link
Contributor Author

Cool, I've made the request and also updated the algorithm to better match the CSS MINDE flow. This also addresses the concern about clipping and converting to the destination space. I've updated it to follow what CSS MINDE does.

A final note, I settled on 1E-12 for the ray size threshold. It's generally recommended either 1E-9 or 1E-12 for high precision cases in double floating point. I'm probably indifferent to whichever, as I don't think there would be a significant difference.

@facelessuser
Copy link
Contributor Author

I've made the account and linked GitHub.

@svgeesus
Copy link
Contributor

svgeesus commented Feb 3, 2026

Thanks! The request for non-participant license commitment has been sent.

@facelessuser
Copy link
Contributor Author

@svgeesus Sorry for not getting back about this, but I currently get the following when I click the link to the non-participant license commitment.

The level of access required for this page is inconsistent with [your account](https://www.w3.org/users/myprofile).
There is not yet an access level assigned to this page. W3C staff may be able to change the access level for this resource using the ,access tool.

@deniak
Copy link
Member

deniak commented Feb 12, 2026

@facelessuser you should be able to submit your commitment using this link.

@facelessuser
Copy link
Contributor Author

For a bit, I was restricted from commenting for some reason, but I've filled out the non-participant license agreement.

@svgeesus
Copy link
Contributor

There is a known problem with the IPR bot currently; I have reported it but meanwhile it is holding up merging any PR with an individual participant commitment (including this one).

@facelessuser
Copy link
Contributor Author

That makes sense. Thanks for the update. Hopefully we'll get it in sooner rather than later.

@svgeesus svgeesus merged commit 609a806 into w3c:main Feb 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants